package com.sky.mapper;

import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {


    List<Long> querySetmealIdbyDishID(List<Long> ids);

    /**
     * 批量插入套餐菜品关系表
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 套餐分页查询 ----》 套餐名称 套餐分类id
     * @param setmealPageQueryDTO
     * @return
     */
    List<Setmeal> queryPage(SetmealPageQueryDTO setmealPageQueryDTO);

    /**
     * 批量删除套餐相关菜品信息
     * @param ids
     */
    void deleteBatch(List<Long> ids);


    @Select("select *from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getBySetmealId(Long id);
}
